#
# Be sure to run `pod lib lint YIM.podspec --allow-warnings' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html
#

# pod lib lint YIM.podspec --allow-warnings --verbose --use-libraries --use-modular-headers
# pod spec lint --allow-warnings --verbose --use-libraries --use-modular-headers

# /bin/bash ./confuse.sh -c
# git commit
# git push
# git tag '*.*.*'
# git push --tag
# pod trunk push YIM.podspec --allow-warnings --verbose --use-libraries --use-modular-headers

Pod::Spec.new do |s|
  s.name             = 'YIM'
  s.version          = '5.1.21'
  s.summary          = 'YIM for ios'

# This description is used to generate tags and improve search results.
#   * Think: What does it do? Why did you write it? What is the focus?
#   * Try to keep it short, snappy and to the point.
#   * Write the description between the DESC delimiters below.
#   * Finally, don't worry about the indent, CocoaPods strips it!

  s.description      = <<-DESC
                        YIM for ios
                       DESC

  # s.resource_bundles = {
  #   'YIM' => ['YIM/Assets/*.png']
  # }
  # s.public_header_files = 'Pod/Classes/**/*.h'
  # s.frameworks = 'libz', 'libc++'
  # s.resources = [
  #   'Assets/**/*',
  #   'Views/**/*.{storyboard,xib}'
  # ]
  # s.static_framework = true
  # s.vendored_frameworks = ['Classes/YFree.framework']
  # s.platform = :ios, '9.0'

  s.homepage         = 'https://gitee.com/lingyang-network-tech/YIM'
  s.license          = { :type => 'MIT', :file => 'LICENSE' }
  s.author           = { '领杨网络科技' => 'lingyangnettech@163.com' }
  s.source           = { :git => 'https://gitee.com/lingyang-network-tech/YIM.git', :tag => s.version.to_s }
  s.ios.deployment_target = '12.0'
  s.swift_version = '5.0'
  s.source_files = 'YIM/Classes/**/*.{h,m,swift}'
  s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' }
#   s.vendored_frameworks = ['YIM/Frameworks/Realm/Realm.xcframework','YIM/Frameworks/Realm/RealmSwift.xcframework']
  s.dependency 'ObjectBox', '~> 4.0.0'
  s.dependency 'AliyunOSSiOS', '~> 2.11.1'
  s.dependency 'Socket.IO-Client-Swift', '16.1.0'
  s.dependency 'Starscream', '4.0.6'
  s.dependency 'ULID.swift', '~> 1.2.0'
  s.dependency 'FYVideoCompressor', '~> 0.0.9'
  s.dependency 'WXImageCompress', '~> 0.1.3'
  s.dependency 'YPush', '~> 3.0.7'
  
  script_objectbox = <<-CMD
    cd $PODS_ROOT
    cd ../ #到项目开发目录
    DIRECTORY="_YIM"
    if [ ! -d "$DIRECTORY" ]; then
      mkdir -p "$DIRECTORY"
    fi
    $PODS_ROOT/ObjectBox/generate_sources.sh -- --output "$PODS_ROOT/YIM/Classes/$DIRECTORY/__YIM.swift" --model-json "./$DIRECTORY/__YIM.json" --no-statistics
  CMD
  
  s.script_phase = [
    { :name => 'script_objectbox', :script => script_objectbox, :shell_path => '/bin/sh', :execution_position => :before_compile}
  ]
end
